package com.gict.antifraudback.exception.assertion;

import com.gict.antifraudback.enums.IResponseEnum;
import com.gict.antifraudback.exception.ArgumentException;
import com.gict.antifraudback.exception.MyException;

import java.text.MessageFormat;

public interface ArgumentExceptionAssert extends IResponseEnum, CustomerAssert {

    @Override
    default MyException newException(Object... args) {
        String msg = MessageFormat.format(this.getMsg(), args);

        return new ArgumentException(this, args, msg);
    }

    @Override
    default MyException newException(Throwable t, Object... args) {
        String msg = MessageFormat.format(this.getMsg(), args);

        return new ArgumentException(this, args, msg, t);
    }

}